/*
特征类
用于保存建立各类基本模型的特征属性
*/

#ifndef BASEFEATURE_H
#define BASEFEATURE_H

#include <Standard_TypeDef.hxx>
#include <QIVtkSelectionPipeline.h>
#include <gp_Pnt.hxx>

class BaseFeature
{
public:
	BaseFeature();
	~BaseFeature();
public:
    Standard_Integer getShapeId();
	void setShapeId(Standard_Integer shapeId);
	gp_Pnt getLocation();
	void setLocation(gp_Pnt location);
	int getFeatureType() {
		return featureType;
	}
	void DeleteOperation(BaseFeature* feature);
	//供子Feature覆写
	virtual int getResultId() { return -1; }
	virtual BaseFeature* getToolFeature() { return nullptr; }
	virtual BaseFeature* getTargetFeature() { return nullptr; }
	void AddOperationToList(BaseFeature* operation);
	virtual void AddOperation(BaseFeature* feature) {};
	std::list<BaseFeature*> GetOperationList();
	


protected:
	//! 1:cube 2:cone 3:sphere 4:cylinder 5:torus 6:brep 7:fillet 8:transform 9:stretch 10:revol 11:hollow
	int featureType = -1;

private:
	//基础建模存储的是Pipeline的ShapeId，操作存储的是resultId
	//!为方便操作，保持resultId、ShapeId、操作Id一致
	Standard_Integer shapeId;
	gp_Pnt location;
	//记录该模型参与的操作
	std::list<BaseFeature*> operationList;
	BaseFeature* targetFeature;
	
};
#endif